package com.nowcoder.code.lcof;

import com.algorithm.model.TreeNode;

public class JZ27 {

    public TreeNode Mirror(TreeNode pRoot) {
        change(pRoot);
        return pRoot;
    }


    public TreeNode change(TreeNode pRoot) {
        if (pRoot == null) {
            return null;
        }
        TreeNode temp = pRoot.left;
        pRoot.left = pRoot.right;
        pRoot.right = temp;
        change(pRoot.left);
        change(pRoot.right);
        return pRoot;
    }

}
